﻿#include "ui/resource.h"

using namespace anip;

ui::ResourceTable ui::currentTheme;

#define ScalarRes(name, val) \
    const bfloat ui::r::name = ui::currentTheme.getBinded<float>(#name, val);
//#define StringRes(name, val) \
    const bwstring ui::r::name = ui::currentTheme.getBinded<wstring>(#name, val);
#define ColorRes(name, _r, _g, _b, _a) \
    const bcolor ui::r::name = ui::currentTheme.getBinded<color>(#name, color{_r, _g, _b, _a});

ScalarRes(CursorWidth,					1);
ScalarRes(FontSize,						14);
ScalarRes(ScrollSpeed,					20);
ScalarRes(RoundRadius,					6);
ScalarRes(DoubleClickThreshold,         0.25);

ScalarRes(Scroller_Size,				5);

ScalarRes(DockedWindow_HeaderFontSize,	16);
ScalarRes(DockedWindow_HeaderSize,		25);
ScalarRes(Window_HeaderFontSize,		18);
ScalarRes(Window_HeaderSize,			28);
ScalarRes(Window_ResizeZoneSize,		7);
ScalarRes(Window_ControlBtn_Size,		16);
ScalarRes(Window_ControlBtn_Distance,	15);
ScalarRes(Window_Focused_ShadowSize,	30);
ScalarRes(Window_Unfocused_ShadowSize,	50);

ScalarRes(MenuBar_Margin,				10);

ScalarRes(Menu_ShadowSize,				10);
ScalarRes(Menu_xMargin,					30);
ScalarRes(Menu_yMargin,					5);
ScalarRes(Menu_RoundRadius,				4);
ScalarRes(Menu_Check_OuterSize,			12);
ScalarRes(Menu_Check_InnerSize,			6);
ScalarRes(Menu_Check_RimSize,			2);
ScalarRes(Menu_Label_FontSize,			10);

ScalarRes(Button_PressFactor,			0.7f);
ScalarRes(Button_HoverFactor,			0.9f);

ScalarRes(Textfield_BorderWidth,		2);

ScalarRes(ListViewItem_TextHeight,		30);

ScalarRes(Autodock_DetachDistance,		100);

ScalarRes(Flow_RowSpacing,				15);
ScalarRes(Flow_LineSpacing,				10);
ScalarRes(Flow_Separator,				10);
ScalarRes(Flow_hMargin,					10);
ScalarRes(Flow_vMargin,					10);

ScalarRes(Flow_Text_hMargin,			5);
ScalarRes(Flow_Text_vMargin,			5);
ScalarRes(Flow_Button_MaxWidth,			300);
ScalarRes(Flow_Slider_Width,			100);
ScalarRes(Flow_Slider_MinHeight,		20);
ScalarRes(Flow_Joystick_Size,			100);

ScalarRes(SplitResizer_Width,           5);

////

ColorRes(Scroller_Color,					0.5f, 0.5f, 0.5f, 0.7f);

ColorRes(TextColor,							0.0f, 0.0f, 0.0f, 1.0f);
ColorRes(CursorColor,						0.0f, 0.0f, 0.0f, 1.0f);

ColorRes(Window_CloseButtonColor,			0.9f, 0.4f, 0.3f, 1.0f);
ColorRes(Window_CaptionColor,				1.0f, 1.0f, 1.0f, 1.0f);
ColorRes(Window_HeaderColor,				0.4f, 0.4f, 0.4f, 1.0f);
ColorRes(Window_BackColor,					0.9f, 0.9f, 0.9f, 1.0f);
ColorRes(Window_Focused_ShadowColor,		0.0f, 0.0f, 0.0f, 0.6f);
ColorRes(Window_Unfocused_ShadowColor,		0.0f, 0.0f, 0.0f, 0.5f);

ColorRes(Menubar_BackColor,					0.97f, 0.97f, 0.97f, 1.0f);
ColorRes(Menu_ShadowColor,					0.0f, 0.0f, 0.0f, 0.3f);
ColorRes(Menu_BackColor,					0.95f, 0.95f, 0.95f, 0.85f);
ColorRes(Menu_LineColor,					0.5f, 0.5f, 0.5f, 1.0f);
ColorRes(Menu_Separator_Color,				0.7f, 0.7f, 0.7f, 1.0f);
ColorRes(MenuItem_HoverColor,				0.6f, 0.7f, 1.0f, 1.0f);
ColorRes(MenuRadioBar_BackColor,			0.95f, 0.95f, 0.95f, 1.0f);

ColorRes(Button_NormalColor,				0.8f, 0.8f, 0.8f, 1.0f);
ColorRes(Button_SelectedColor,				0.5f, 0.6f, 1.0f, 1.0f);

ColorRes(Textfield_BackColor,				0.95f, 0.95f, 0.95f, 1.0f);
ColorRes(Textfield_BorderColor,				0.7f, 0.7f, 0.7f, 1.0f);
ColorRes(Textfield_FocusedBorderColor,		0.4f, 0.6f, 0.7f, 1.0f);

ColorRes(Slider_BackColor,					0.7f, 0.7f, 0.7f, 1.0f);
ColorRes(Slider_ForeColor,			    	0.5f, 0.5f, 0.5f, 1.0f);

ColorRes(Tabctrl_Header_NormalColor,		0.8f, 0.8f, 0.8f, 1.0f);
ColorRes(Tabctrl_Header_SelectedColor,		0.95f, 0.95f, 0.95f, 1.0f);
ColorRes(Tabctrl_Header_NormalTextColor,	0.4f, 0.4f, 0.4f, 1.0f);
ColorRes(Tabctrl_Header_SelectedTextColor,	0.0f, 0.0f, 0.0f, 1.0f);

ColorRes(DockContainer_HintColor,           0.2f, 0.2f, 1.0f, 0.3f);

#undef ColorRes
#undef ScalarRes